package com.yupi.yupao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yupi.yupao.model.domain.Message;
import com.yupi.yupao.model.domain.TeamMessage;
import com.yupi.yupao.model.domain.User;
import com.yupi.yupao.service.TeamMessageService;
import com.yupi.yupao.mapper.TeamMessageMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class TeamMessageServiceImpl extends ServiceImpl<TeamMessageMapper, TeamMessage>
    implements TeamMessageService{

    //    发送信息
    @Override
    public boolean insertMessage(TeamMessage teamMessage) {
        boolean save = this.save(teamMessage);
        return save;
    }

    @Override
    public List<TeamMessage> getMessageByTid(long teamId) {
        QueryWrapper<TeamMessage> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("teamId",teamId);

//        开始查询
        List<TeamMessage> teamMessageList = this.list(queryWrapper);

        return teamMessageList;

    }
}




